<?php
require_once('School.php');
require_once('AuthorDAO.php');
class Author
{

	public $id;
	public $name;
	public $year;
	public $school;
	private $dao;

	public function __construct($id, $name, $year, $schoolId)
	{
		$this->id = $id;
		$this->name = $name;
		$this->school = School::findById($schoolId);
		$this->year = $year;
		$this->dao = new AuthorDAO();

	}

	public static function findBySchool($school)
	{
		
	}
	public static function findYearsBySchool($school)
	{
		$dao = new AuthorDAO();
		return $dao->findYearsBySchool($school->id);
	}
	public static function findBySchoolYear($school, $year)
	{
		$dao = new AuthorDAO();
		return $dao->findBySchoolYear($school->id, $year);		
	}
	public static function findById($id)
	{
		$dao = new AuthorDAO();
		return $dao->findById($id);
	}

	public static function findAll()
	{
		
	}
	public function getDoodles()
	{
		return $this->dao->getDoodles($this);
	}
}
?>